#!usr/bin/env python  
# -*- coding:utf-8 -*-
from .models import Course,Lesson,Video,CourseResource
import xadmin

class CourseAdmin(object):
    list_display = ['name', 'desc', 'detail', 'degree','learn_times','students','fav_num','image','click_nums','add_time']
    search_fields = ['name', 'desc', 'detail', 'degree','learn_times','students','fav_num','image','click_nums']
    list_filter = ['name', 'desc', 'detail', 'degree','learn_times','students','fav_num','image','click_nums','add_time']
xadmin.site.register(Course,CourseAdmin)

class LessonAdmin(object):
    list_display = ['course','name','add_time']
    search_fields = ['course','name']
    list_filter = ['course__name','name','add_time']
xadmin.site.register(Lesson, LessonAdmin)

class VideoAdmin(object):
    list_display = ['lesson','name','add_time']
    search_fields = ['lesson','name']
    list_filter = ['lesson','name','add_time']
xadmin.site.register(Video, VideoAdmin)

class CourseResourceAdmin(object):
    list_display = ['course','name','add_time','dowload']
    search_fields = ['course','name']
    list_filter = ['course','name','add_time','dowload']
xadmin.site.register(CourseResource, CourseResourceAdmin)